
// 基于template/src/views/{{appModules}}/{{pages@DETREEVIEW}}/{{spinalCase page.codeName}}-hook.ts.hbs生成
import { QXEvent } from 'qx-util';
import {
	TreeViewActionType,
	TreeViewController,
	ITreeViewAbility,
	ITreeViewControllerParams,
	IParam,
	IViewEvent,
} from '@/core';
import {
	useTreeViewProps,
	useTreeViewBasic,
	useTreeViewControllerParams,
    useTreeViewAction,
} from '@/hooks/view/use-tree-view';
import { model } from "./ibizbook-usr-2-tree-view-model";

/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useTreeViewProps()
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useTreeViewBasic(model, props)
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
        ...useTreeViewAction(controller)
    }
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<IViewEvent<TreeViewActionType, ITreeViewAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<IViewEvent<TreeViewActionType, ITreeViewAbility>>
) {
	const params: ITreeViewControllerParams<
		TreeViewActionType,
		ITreeViewAbility
	> = useTreeViewControllerParams(model, props, evt);
	return new TreeViewController(params);
}